﻿@model Tuple<IEnumerable<HCM_maps_website.Process.Location>,int>

@{
    ViewBag.Title = "Imagelocation";
    Layout = "~/Views/Shared/_LayoutAdmin.cshtml";
}

<div id="content_page" class="imagelocation_page">
    <div id="data_content">
        <table cellpadding="0" cellspacing="0">
            <tr>
                <th>ID</th>
                <th>Location</th>
            </tr>
            @foreach(var loc in Model.Item1){ 
                <tr>
                    <td name="id">@loc.IDImage</td>
                    <td name="location">@loc.Location1</td>
                </tr>
            }
        </table>
    </div>
    <div id="pagination">
        <form id="submitpage" action="@Url.Action("Imagelocation")">
            <select name="ipage" onchange="SubmitForm('submitpage')">
                @if(@Model.Item2>HCM_maps_website.Controllers.AdminController.NUM_RECORD_PER_PAGE){
                    var page = (((@Model.Item2 % HCM_maps_website.Controllers.AdminController.NUM_RECORD_PER_PAGE != 0) ? 1 : 0) + @Model.Item2 / HCM_maps_website.Controllers.AdminController.NUM_RECORD_PER_PAGE);
                    for (int i = 0; i < page; i++)
                     {
                        if(Session["page"]!=null && (int)Session["page"] == i+1){
                        <option selected value="@(i+1)">page @(i+1)</option>
                        }else{
                            <option value="@(i+1)">page @(i+1)</option>
                        }
                    
                     }
                }
            </select>
        </form>
    </div>
        <div class="clear"></div>
   @* <form id="EditForm" class="Processdata" action="@Url.Action("EditImageLocation")">
        <span class="row"><label>Image location Info:</label></span>
        <span class="row"><label>Id image:</label><input type=text name="id" /></span>
        <span class="row"><label>Location:</label><input type="text" name="location"/></span>

        <span class="row"><input type="submit" value="Update" name="editadd" />
        <input type="submit" value="Delete" name="editadd" /></span>
        <div class="clear"></div>
    </form>

    <form id="AddForm" class="Processdata" action="@Url.Action("InsertImageLocation")"> 
        <span class="row"><label>Image location Info:</label><input style="margin-left:50px;" type="submit" id="copyabove" value="Copy Above" onclick="return false;" /></span>
        <span class="row"><label>Id image:</label><input type=text name="id" /></span>
        <span class="row"><label>Location:</label><input type="text" name="location"/></span>

        <span class="row"><input type="submit" value="Add" /></span>
        <div class="clear"></div>
    </form>*@
</div>

